package org.vectrics.recruiter.job;

import org.vectrics.domain.Domain;
import org.vectrics.provider.CoreServiceLocator;
import org.vectrics.recruiter.config.RecruitConfig;

/**
 * @author mmoore
 */
public class SimpleJobRefIdGen implements JobReferenceIdGen {
	
	public String generate(Domain domain, Job job) {
		String refId =
			CoreServiceLocator.getSurrogateKeyService().getKey("job.ref.id").toString();
		String prefix = RecruitConfig.getRecruitInstance().getJobReferenceIdPrefix(domain);
		if ((prefix != null) && (prefix.trim().length() > 0)) {
			refId = prefix + refId;
		}
		return(refId);
	}
	
}
